Kronecker Algebra-based Deadlock Analysis in the Linux Kernel

نویسنده

  • Yoojin Park
چکیده

Multi-core technology has moved concurrent programming to the forefront of computer science. The C programming language explicitly supports concurrent programming through POSIX threads. Threads execute in parallel and communicate via shared objects that can be locked using synchronized access to achieve mutual exclusion. However, with concurrent programming comes a new set of problems that can hamper the quality of the software. Deadlocks are category from such a problem. The Linux kernel currently deploys on many different architectures. The Linux kernel source now has 12 million lines of code. The code of Linux kernel is mostly written in C. As of now, The Linux kernel source-code defines 45 kernel threads. For several kernel threads, multiple threads in sharing are executing in parallel at runtime. The Linux kernel-level synchronization primitives are software mechanisms provided by the operating system for the purpose of supporting kernel thread synchronization. Examples are memory barriers, atomic operations, mutexes, spinlocks. Erroneous use of synchronization primitives is difficult to detect by testing. It leads to deadlocks in the Linux kernel on multi-core processor architectures. This report describes a static analysis for C-code to detect deadlocks due to erroneous use of spinlocks. The intended application is the detection of deadlocks in the Linux kernel. A major obstacle is the sheer size of the Linux kernel source-code. We analyze the entire source code of all 45 concurrent threads defined in the Linux kernel. The sizes of the control flow graphs (CFGs) of the underlying kernel threads are intractable for static analysis. We thus devise a reduction mechanism to eliminate CFG nodes which are not relevant for deadlock detection. We define graph rewrite rules to make problem sizes tractable. Deadlocks constitute a locking hierarchy violation. In our analysis, we show that spinlocks which can be shown to adhere to a given locking hierarchy are irrelevant for deadlock detection. This allows us to omit such locks and thus further reduce the problem size. Kronecker algebra is a matrix calculus that has been proven useful for analysing multi-threaded programs. Our analysis for deadlock detection among Linux kernel threads is based on Kronecker algebra. We employ Kronecker algebra on the entire Linux kernel source-tree to detect deadlocks.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

One Million (LOC) and Counting: Static Analysis for Errors and Vulnerabilities in the Linux Kernel Source Code

This article describes an analysis tool aimed at the C code of the Linux kernel, having been first described as a prototype (in this forum) in 2004. Its continuing maturation means that it is now capable of treating millions of lines of code in a few hours on very modest platforms. It detects about two uncorrected deadlock situations per thousand C source files or million lines of source code i...

متن کامل

Lazy Parallel Kronecker Algebra-Operations on Heterogeneous Multicores

Kronecker algebra is a matrix calculus which allows the generation of thread interleavings from the source-code of a program. Thread interleavings have been shown effective for proving the absence of deadlocks. Because the number of interleavings grows exponentially in the number of threads, deadlock analysis is still a challenging problem. To make the computation of thread interleavings tracta...

متن کامل

Kronecker Factorization for Speeding up Kernel Machines

In kernel machines, such as kernel principal component analysis (KPCA), Gaussian Processes (GPs), and Support Vector Machines (SVMs), the computational complexity of finding a solution is O(n), where n is the number of training instances. To reduce this expensive computational complexity, we propose using Kronecker factorization, which approximates a positive definite kernel matrix by the Krone...

متن کامل

Checking for Deadlock, Double-Free and Other Abuses in the Linux Kernel Source Code

The analysis described in this article detects about two real and uncorrected deadlock situations per thousand C source files or million lines of code in the Linux kernel source, and three accesses to freed memory, at a few seconds per file. In distinction to model-checking techniques, the analysis applies a configurable “3-phase” Hoare-style logic to an abstract interpretation of C code to obt...

متن کامل

Cartesian Kernel: An Efficient Alternative to the Pairwise Kernel

Pairwise classification has many applications including network prediction, entity resolution, and collaborative filtering. The pairwise kernel has been proposed for those purposes by several research groups independently, and has been used successfully in several fields. In this paper, we propose an efficient alternative which we call a Cartesian kernel. While the existing pairwise kernel (whi...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2017